package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.dao.impl.UserDaoImpl;
import com.itheima.service.UserService;

public class UserServiceImpl implements UserService {
    private UserDaoImpl userDao;
    private String name;
    private int age;

    public UserServiceImpl(UserDaoImpl userDao, String name, int age) {
        this.userDao = userDao;
        this.name = name;
        this.age = age;
    }

    public UserServiceImpl() {
    }

    public void setUserDao(UserDaoImpl userDao) {
        this.userDao = userDao;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public void save() {
        System.out.println("UserServiceImpl save is running..");
    }


    public void show(){
        System.out.println("UserServiceImpl save is running.."+name+","+age);
        userDao.show();
    }
}